package tc.crase.view;

import tc.common.registry.Filter;
import tc.common.registry.Obj;
import tc.crase.db.XattrGIT;
import tc.crase.db.XattrGRP;
import tc.crase.db.Xobject;
import tc.crase.sys.XobjectEx;

public class FilterGraph implements Filter {
	XattrGRP attrGraph;
	
	FilterGraph(XattrGRP attrGraph) {
		this.attrGraph = attrGraph;
	}
	
	public boolean pass(Obj obj) {
		for (XattrGIT attrGit : attrGraph) {
			if (attrGit == null) continue;
			Xobject xobj = attrGit.getParent();
			XobjectEx xobjEx = (XobjectEx)xobj;
			if ( obj == (Obj)xobjEx.objex ) return true; 
		}
		
		return false;
	}
}
